package service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.lang.reflect.Method;

/**
 * @author oldliu
 * @since 1.0
 */
public class AopTest {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("aop.xml");
        UserService userService = ac.getBean("userService", UserService.class);
        int add = userService.add(100, "杨自强", "113333");
        System.out.println(">>>>>>>>>>>>"+add);

        System.out.println("类名："+userService.getClass().getName());
        System.out.println("父类："+userService.getClass().getSuperclass());
        System.out.println("实现的接口：");
        for(Class c:userService.getClass().getInterfaces()){
            System.out.println(c);
        }
        System.out.println("方法：");
        Method[] mr = userService.getClass().getDeclaredMethods();
        for(Method m:mr)
            System.out.println(m);
    }
}
